---
layout: "default"
title: "removeLast"
description: "Swift documentation for 'removeLast': Remove an element from the end of x  in O(1)."
keywords: "removeLast,func,swift,documentation"
root: "/v1.2"
---

<div class="declaration" id="func-removelast-c_-rangereplaceablecollectiontype-where-c-index_-bidirectionalindextype-inout_-c">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-removelast-c_-rangereplaceablecollectiontype-where-c-index_-bidirectionalindextype-inout_-c">func <wbr>removeLast&lt;C :<wbr> RangeReplaceableCollectionType where C.Index : BidirectionalIndexType&gt;(<wbr>inout: C)</a>
        
<div class="comment collapse" id="comment-func-removelast-c_-rangereplaceablecollectiontype-where-c-index_-bidirectionalindextype-inout_-c"><div class="p">
    <p>Remove an element from the end of <code>x</code>  in O(1).
Requires: <code>x</code> is nonempty</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func removeLast&lt;C : RangeReplaceableCollectionType where C.Index : BidirectionalIndexType&gt;(inout x: C) -&gt; C.Generator.Element</code>
    
    
</div></div>
</div>
